package com.hqyj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hqyj.dao.RoleMapper;
import com.hqyj.pojo.DataMessage;
import com.hqyj.pojo.Role;
import com.hqyj.pojo.User;
import com.hqyj.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleMapper roleMapper;

    @Override
    public DataMessage queryAll(Role role) {
        DataMessage data = new DataMessage();
        List<Role> list = roleMapper.queryAll(role);
        if(list.size()>0){
            data.setSuccess(true);
            data.setData(list);
        }else{
            data.setSuccess(false);
            data.setInfo("查询失败");
        }
        return data;
    }


}
